<?php
namespace Badmins\Model;
use Think\Model;
class CityModel extends Model{
	protected $_validate = array(
			array('name','require','城市名称必须'),
			/* array('name','','城市名已存在',0,'unique',1), */
			array('photo,parent_id','Ckphoto','商品图片必须',1,'callback',3),
	);
	public function Ckphoto($data){
		if($data['parent_id'] == 2){
			if(empty($data['photo'])){
				return false;
			}
			return true;
		}
		return true;
	}
}